package com.example.blog.demos.web.mapper;

import com.example.blog.demos.web.model.UserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * 链接数据库
 * @author Q
 * @create 2025-06-19-21:33
 */
@Mapper
public interface UserInfoMapper {
    /**
     * 根据用户名查询信息
     * @param name
     * @return
     */
    @Select("select id, user_name,password, github_url from `user` where user_name = #{name} and delete_flag=0")
    UserInfo selectByName(String name);

    /**
     * 根据用户Id查询信息
     * @param id
     * @return
     */
    @Select("select id, user_name, github_url from `user` where id = #{id} and delete_flag=0")
    UserInfo selectById(Integer id);

}
